<template>
	<view class="content-view">
		<view class="news-title">{{detail.title}}</view>
		<view class="news-info">
			<view class="count">
				<up-icon name="eye" size="20"></up-icon>
				<view>{{detail.pageView}}</view>
			</view>
			<view class="org">
				<view>{{detail.createTime}}</view>
			</view>
		</view>
		<view class="news-content">
			<up-parse :content="detail.contents"></up-parse>
		</view>
	</view>
</template>

<script>
	import {propagateNewsApi} from '@/api/news/propagate-news-api.js'
	export default {
		data() {
			return {
				detail:{},
			}
		},
		onLoad(options) {
			let title = options.title
			if(title) {
				uni.setNavigationBarTitle({
					title
				})
			}
			this.getDetail(options.id)
		},
		methods:{
			async getDetail(id){
				const result = await propagateNewsApi.getDetail(id);
				this.detail = result.data;
			}
		}
	}
</script>

<style lang="scss" scoped>
	.news-title {
		font-weight: 700;
		font-size: 16px;
		line-height: 25px;
	}
	.news-info {
		display: flex;
		justify-content: space-between;
		align-items: center;
		font-size: 26rpx;
		color: $uni-text-color-grey;
		padding: 20px 0;
		.org, .count {
			display: flex;
			align-items: center;
		}
		
		:deep(.u-iconfont) {
			color: $uni-text-color-grey !important;
		}
	}
	.news-content {
		font-size: 13px;
		color: #333333;
		line-height: 25px;
	}
</style>